﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;
using WinnerCMS.Model.Attribute;

#endregion

namespace WinnerCMS.WebUI.Admin.Window
{
    [Access]
    public partial class GetContentProperty : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindList(1);
            }
        }

        public void BindList(int PageNo)
        {
            this.GV_List.EmptyDataTemplate = WebFactory.PageBase.GetTemplate(this);

            var pp = new PagingParam();
            pp.PageNo = PageNo;
            pp.PageSize = this.PageNavigation1.PageSize;

            this.GV_List.DataSource = new ContentPropertyManage().BindList(byte.Parse(Request["ModelId"]),
                (ContentPropertyOption) Convert.ToInt32(Request["Type"]), this.txtKeyWord.Text, pp);

            this.GV_List.DataBind();

            this.PageNavigation1.RecordCount = pp.RecordCount;
        }


        protected void PageNavigation1_PageChanging(object src, WebControls.PageChangingEventArgs e)
        {
            BindList(e.NewPageIndex);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BindList(1);
        }
    }
}